# 使用官方 Python 镜像
FROM python:3.9-slim

# 设置工作目录
WORKDIR /app

# 安装应用依赖
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip install gunicorn

# 复制应用代码到容器
COPY . .
#ADD world_info.py app.py

RUN mkdir /tmp/gunicorn
RUN touch gunicorn_error.log

# 设置环境变量
ENV PORT=8050

# 设置默认命令
CMD ["gunicorn", "world_info:server", "-c", "./gunicorn.conf.py"]
